package entry;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

@WebFilter("/*")
public class CommonServer implements Filter {

    @Override
    public void init(FilterConfig filterConfig) throws ServletException {

    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        //做一些判断，然后看是否放行

        filterChain.doFilter(servletRequest,servletResponse);
//      servletResponse
        //servletResponse.setHeader("Access-Control-Allow-Origin", curOrigin);
        //servletResponse.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT");
    }

    @Override
    public void destroy() {

    }
}
